3.353 \(\int \frac{\cot (e+f x)}{(a+b \sec ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=83 \[ \frac{b^2}{2 a^2 f (a+b) \left (a \cos ^2(e+f x)+b\right )}+\frac{b (2 a+b) \log \left (a \cos ^2(e+f x)+b\right )}{2 a^2 f (a+b)^2}+\frac{\log (\sin (e+f x))}{f (a+b)^2} \]

[Out]

b^2/(2*a^2*(a + b)*f*(b + a*Cos[e + f*x]^2)) + (b*(2*a + b)*Log[b + a*Cos[e + f*x]^2])/(2*a^2*(a + b)^2*f) + L
og[Sin[e + f*x]]/((a + b)^2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.113657, antiderivative size = 83, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4138, 446, 88} \[ \frac{b^2}{2 a^2 f (a+b) \left (a \cos ^2(e+f x)+b\right )}+\frac{b (2 a+b) \log \left (a \cos ^2(e+f x)+b\right )}{2 a^2 f (a+b)^2}+\frac{\log (\sin (e+f x))}{f (a+b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

b^2/(2*a^2*(a + b)*f*(b + a*Cos[e + f*x]^2)) + (b*(2*a + b)*Log[b + a*Cos[e + f*x]^2])/(2*a^2*(a + b)^2*f) + L
og[Sin[e + f*x]]/((a + b)^2*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin{align*} \int \frac{\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^5}{\left (1-x^2\right ) \left (b+a x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{x^2}{(1-x) (b+a x)^2} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (-\frac{1}{(a+b)^2 (-1+x)}+\frac{b^2}{a (a+b) (b+a x)^2}-\frac{b (2 a+b)}{a (a+b)^2 (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=\frac{b^2}{2 a^2 (a+b) f \left (b+a \cos ^2(e+f x)\right )}+\frac{b (2 a+b) \log \left (b+a \cos ^2(e+f x)\right )}{2 a^2 (a+b)^2 f}+\frac{\log (\sin (e+f x))}{(a+b)^2 f}\\ \end{align*}

Mathematica [A]  time = 0.361978, size = 112, normalized size = 1.35 \[ \frac{\sec ^4(e+f x) (a \cos (2 (e+f x))+a+2 b)^2 \left (\frac{b^2 (a+b)}{a^2 \left (-a \sin ^2(e+f x)+a+b\right )}+\frac{b (2 a+b) \log \left (-a \sin ^2(e+f x)+a+b\right )}{a^2}+2 \log (\sin (e+f x))\right )}{8 f (a+b)^2 \left (a+b \sec ^2(e+f x)\right )^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

((a + 2*b + a*Cos[2*(e + f*x)])^2*Sec[e + f*x]^4*(2*Log[Sin[e + f*x]] + (b*(2*a + b)*Log[a + b - a*Sin[e + f*x
]^2])/a^2 + (b^2*(a + b))/(a^2*(a + b - a*Sin[e + f*x]^2))))/(8*(a + b)^2*f*(a + b*Sec[e + f*x]^2)^2)

________________________________________________________________________________________

Maple [A]  time = 0.092, size = 155, normalized size = 1.9 \begin{align*}{\frac{{b}^{2}\ln \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a+b \right ) ^{2}{a}^{2}}}+{\frac{b\ln \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }{f \left ( a+b \right ) ^{2}a}}+{\frac{{b}^{2}}{2\,f \left ( a+b \right ) ^{2}a \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{{b}^{3}}{2\,f \left ( a+b \right ) ^{2}{a}^{2} \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{\ln \left ( 1+\cos \left ( fx+e \right ) \right ) }{2\,f \left ( a+b \right ) ^{2}}}+{\frac{\ln \left ( -1+\cos \left ( fx+e \right ) \right ) }{2\,f \left ( a+b \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)/(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/2/f*b^2/(a+b)^2/a^2*ln(b+a*cos(f*x+e)^2)+1/f*b/(a+b)^2/a*ln(b+a*cos(f*x+e)^2)+1/2/f*b^2/(a+b)^2/a/(b+a*cos(f
*x+e)^2)+1/2*b^3/a^2/(a+b)^2/f/(b+a*cos(f*x+e)^2)+1/2/f/(a+b)^2*ln(1+cos(f*x+e))+1/2/f/(a+b)^2*ln(-1+cos(f*x+e
))

________________________________________________________________________________________

Maxima [A]  time = 1.00624, size = 158, normalized size = 1.9 \begin{align*} \frac{\frac{b^{2}}{a^{4} + 2 \, a^{3} b + a^{2} b^{2} -{\left (a^{4} + a^{3} b\right )} \sin \left (f x + e\right )^{2}} + \frac{{\left (2 \, a b + b^{2}\right )} \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{4} + 2 \, a^{3} b + a^{2} b^{2}} + \frac{\log \left (\sin \left (f x + e\right )^{2}\right )}{a^{2} + 2 \, a b + b^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/2*(b^2/(a^4 + 2*a^3*b + a^2*b^2 - (a^4 + a^3*b)*sin(f*x + e)^2) + (2*a*b + b^2)*log(a*sin(f*x + e)^2 - a - b
)/(a^4 + 2*a^3*b + a^2*b^2) + log(sin(f*x + e)^2)/(a^2 + 2*a*b + b^2))/f

________________________________________________________________________________________

Fricas [A]  time = 0.995817, size = 313, normalized size = 3.77 \begin{align*} \frac{a b^{2} + b^{3} +{\left (2 \, a b^{2} + b^{3} +{\left (2 \, a^{2} b + a b^{2}\right )} \cos \left (f x + e\right )^{2}\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) + 2 \,{\left (a^{3} \cos \left (f x + e\right )^{2} + a^{2} b\right )} \log \left (\frac{1}{2} \, \sin \left (f x + e\right )\right )}{2 \,{\left ({\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} f \cos \left (f x + e\right )^{2} +{\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/2*(a*b^2 + b^3 + (2*a*b^2 + b^3 + (2*a^2*b + a*b^2)*cos(f*x + e)^2)*log(a*cos(f*x + e)^2 + b) + 2*(a^3*cos(f
*x + e)^2 + a^2*b)*log(1/2*sin(f*x + e)))/((a^5 + 2*a^4*b + a^3*b^2)*f*cos(f*x + e)^2 + (a^4*b + 2*a^3*b^2 + a
^2*b^3)*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 2.07845, size = 567, normalized size = 6.83 \begin{align*} \frac{\frac{{\left (2 \, a b + b^{2}\right )} \log \left (a + b + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{4} + 2 \, a^{3} b + a^{2} b^{2}} + \frac{\log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a^{2} + 2 \, a b + b^{2}} - \frac{2 \, a b + b^{2} + \frac{4 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{2 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{{\left (a^{3} + a^{2} b\right )}{\left (a + b + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}} - \frac{2 \, \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}{a^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/2*((2*a*b + b^2)*log(a + b + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e
) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/(a^4 + 2*a
^3*b + a^2*b^2) + log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/(a^2 + 2*a*b + b^2) - (2*a*b + b^2 + 4*a*b*(cos(
f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2*a*b*(cos(f*x + e) - 1)^2/(c
os(f*x + e) + 1)^2 + b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((a^3 + a^2*b)*(a + b + 2*a*(cos(f*x + e)
- 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1
)^2 + b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)) - 2*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)/a^2)/f